package com.yayo.mangement.service.impl;

import com.google.common.collect.Maps;
import com.yayo.mangement.conf.DbConfig;
import com.yayo.mangement.dao.TableFieldDao;
import com.yayo.mangement.model.TableField;
import com.yayo.mangement.response.Response;
import com.yayo.mangement.service.TableFieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TableFieldServiceImpl implements TableFieldService {

    @Autowired
    private TableFieldDao tableFieldDao;

    @Override
    public List<TableField> tableDetail(String tableName) {
        Map<String, Object> params = Maps.newHashMap();
        params.put("tableName",tableName);
        params.put("databaseName",DbConfig.getDbName());
        List<TableField> tableField = tableFieldDao.findListByTable(params);
        return tableField;
    }
}
